<?php

namespace App\Model;

use Illuminate\Database\Eloquent\Model;

class DepositModel extends Model
{
    //定义一个表名
    protected $table = 'deposit';
    //定义主键
    protected $primaryKey = 'id';
	protected $guarded = [];

	function getUsernameAttribute($value)
	{
		$user = UserModel::where('id',$this->uid)->first();
		if($user['login_type'] == 1){
			return $user['phone'];
		}else{
			return $user['email'];
		}
	}
}
